<?php 
namespace Admin\Model;
use Think\Model\RelationModel;
class UserModel extends RelationModel{     
	protected $tableName = 'user';
	protected $_link = array(
			'role' =>array(
				'mapping_type'			=>  self::MANY_TO_MANY,
				'foreign_key'      		=>  'user_id',    
				'relation_foreign_key'  =>  'role_id',
				'relation_table'    	=>  'tb_role_user',
				'mapping_fields'        =>  'id,name,remark',
				),


		);

}

 ?>